package com.wanqing.community.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.wanqing.community.bean.UserDetailBean;
import com.wanqing.community.dao.UserDetailDao;
import com.wanqing.community.dao.util.MyBatisDao;
import com.wanqing.community.util.ConditionParse;

/**
 * 用户明细DAO实现
 * @author JX
 *
 */
@Repository("userDetailDao")
public class UserDetailDaoImpl extends MyBatisDao<UserDetailBean, String> implements UserDetailDao {

	private final String NAMES_SPACE = "com.wanqing.community.bean.UserDetailBean";
	
	/**
	 * <p>Description:添加用户明细单<p>
	 * <p>modifiContent:</p>
	 * @param  userDetail
	 * @return int
	 */
	public int addUserDetail(UserDetailBean userDetail) {		
		return this.save(NAMES_SPACE+".addUserDetail", userDetail);
	}
	
	
	/**
	 * <p>Description:通过Id判断<p>
	 * <p>modifiContent:</p>
	 * @param  userDetail
	 * @return 
	 */
	public List<UserDetailBean> findUserDetailById(String Id) {		
		return this.queryForList(NAMES_SPACE+".findUserDetailById", Id);
	}
	
	/**
	 * <p>Description:修改明细<p>
	 * <p>modifiContent:</p>
	 * @param  userDetail
	 * @return int
	 */
	public int updateUserDetail(UserDetailBean userDetail){
		return this.update(NAMES_SPACE+".updateUserDetail", userDetail);
	}
	
	/**
	 * <p>Description:获得用户明细单数<p>
	 * <p>modifiContent:</p>
	 * @param  userDetail
	 * @return int
	 */
	public int getUserDetailCount(ConditionParse condParse)
	{
		return this.getCount(NAMES_SPACE+".getUserDetailCount", condParse);
	}
	
	/**
	 * <p>Description:通过Id删除明细<p>
	 * <p>modifiContent:</p>
	 * @param  userDetail
	 * @return 
	 */
	public int deleteUserDetailbyId(String udId) {		
		return this.delete(NAMES_SPACE+".deleteUserDetailbyId", udId);
	}

	
}
